<%@ page language="java"  pageEncoding="UTF-8"%>
<%@include file="/common/taglibs.jsp" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
	    <title><fmt:message key="policyDetail.heading"/></title>
	    <script type="text/javascript" src="${ctxPath}/resource/front/lib/jquery.bgiframe.min.js" ></script>
		<script type="text/javascript" src="${ctxPath}/resource/front/lib/jquery.ajaxQueue.js" ></script>
		<script type="text/javascript" src="${ctxPath}/resource/front/lib/thickbox-compressed.js" ></script>
		<script type="text/javascript" src="${ctxPath}/resource/front/lib/jquery.autocomplete.js" ></script>
	 	<script type="text/javascript" src="${ctxPath}/resource/admin/js/citys.js" ></script>
	 	<link rel="stylesheet" type="text/css" href="${ctxPath}/resource/front/lib/jquery.autocomplete.css" />
	 	<script type="text/javascript">
		$(function() {
			setEmptyCheck("flightCode:startdateTicket:enfdateTicket:startDate:endDate:beforeValidDay:dpt:arrCity:backNote:cabinNote");
			setMoneyCheck("returnPoint");
			setCheckEnglish("cabin");
			setPositiveNegative("returnPrice");
			applyDate("startdateTicket");
			applyDate("enfdateTicket");
			applyDate("startDate");
			applyDate("endDate");
			
			
		});
		function showValue(obj){
			if(obj.value==3){
				$("#yCharge").show();
				$("#zd").hide();
			}if(obj.value==4){
				$("#yCharge").hide();
				$("#zd").show();
			}
		};
		function showDiscountType(type){
			if(type==1){
				$("#showDiscount").show();
				$("#showZpoint").hide();
			}if(type==2){
				$("#showDiscount").hide();
				$("#showZpoint").show();
			}
		}
		function showKtype(obj){
			if(obj.value==1){
				$("#enbleKtype").show();
				$("#disenbleKtype").hide();
			}	if(obj.value==0){
				$("#enbleKtype").hide();
				$("#disenbleKtype").show();
			}
		}
		function showLx(obj){
			if(obj.value==1){
				$("#lx").show();
			}	if(obj.value==0){
				$("#lx").hide();
				$("#downDiscount").val('');
			}
		}	
		function displayAuto(obj){
			if(obj.value==3){
				$("#showPay").hide();
				$("#autoTicket").show();
				$("#showPata").show();
				$("#showPnr").hide();
				$("li[name='auto']").show();
				$("li[name='showCabin']").hide();
			}else if(obj.value==4){
				$("#showPay").show();
				$("#autoTicket").hide();
				$("#showPata").hide();
				$("li[name='showCabin']").show();
				$("li[name='auto']").hide();
				$("#showPnr").hide();
			}else if(obj.value==5){
				$("#showPnr").show();
				$("#showDiscountType").show();
				$("#showPay").hide();
				$("#autoTicket").hide();
				$("#showPata").hide();
				$("li[name='auto']").hide();
				$("li[name='showCabin']").hide();
			}
		}
		
		function setTavelDate(){
			if($("#like").attr("checked")){
				$("#startDate").val($("#startdateTicket").val());	
				$("#endDate").val($("#enfdateTicket").val());	
			}
		}
		
		function disabledFlight(obj){
			if(obj.value==1){
				$("#withIn").attr("disabled","disabled");
				$("#withOut").attr("disabled","disabled");
			}if(obj.value==2){
				$("#withIn").attr("disabled","disabled");
				$("#withOut").attr("disabled",false);
			}if(obj.value==3){
				$("#withOut").attr("disabled","disabled");
				$("#withIn").attr("disabled",false);
			}
		}
		
		/* $(function(){
			CKEDITOR.replace( 'cabinNote',
					{
					toolbar : 'Basic',
					width : '750px',
					height : '250px'
					});
			CKEDITOR.replace( 'backNote',
					{
					toolbar : 'Basic',
					width : '750px',
					height : '250px'
					});
			}); */
	 	</script>
  </head>
  <body>
  
  
  <form:form method="post" id="policy" commandName="policy" action="editPolicy.do">	
	<form:hidden path="policyId"/>	
	<ul>
	  <li class="titleonly"><img src="${ctxPath}/css/style/base/image/dot.gif" width="15" height="16" class="dot" />&gt;&gt;
	  添加特殊政策<a href="javascript:history.back()" ><img src="${ctxPath}/css/style/base/image/backtrack.gif" width="14" height="14" align="absmiddle" class="backtrack"/>返回</a></li>
	</ul>
	
	<ul>
	 <li class="listwhile" style="font-weight:bold; color:#FF0000; ">
			 <input type="radio" value="3" name="policyType" class="class" <c:if test="${policy.policyType==3 ||param['type']==3}">checked="checked"</c:if>  onclick="displayAuto(this)"/>&nbsp;&nbsp;申请产品&nbsp;&nbsp;&nbsp;&nbsp;
			 <input type="radio" value="4" name="policyType" class="class" <c:if test="${policy.policyType==4 ||param['type']==4}">checked="checked"</c:if> onclick="displayAuto(this)"/>&nbsp;&nbsp;包机切位产品&nbsp;&nbsp;&nbsp;&nbsp;
			 <input type="radio" value="5" name="policyType" class="class" <c:if test="${policy.policyType==5 ||param['type']==5}">checked="checked"</c:if> onclick="displayAuto(this)"/>&nbsp;&nbsp;预付产品
			 </li>
	  <li class="listgrey"><span class="colorFF0000">&lowast;</span> 航空公司
	    <input id="flightCode" name="flightCode" value="${policy.flightCode }" type="text" class="inputbox60" maxlength="2" check=2 tip="一条政策只能对应一个航空公司，只支持航空公司二字码输入，如:CA"  /> 
		&nbsp;&nbsp;<font color="#999999">一条政策只能对应一个航空公司，只支持航空公司二字码输入，如:CA </font>
	  </li>
	  <li class="listwhile">&nbsp;&nbsp;&nbsp; 政策代码
		<input name="policyCode" value="${policy.policyCode}" type="text" class="inputbox60"  /> 
	  </li>
	  <li class="listgrey"><span class="colorFF0000">&lowast;</span> 销售期限
	 
	    <input id="startdateTicket" name="startdateTicket" check=2 tip="输入格式：YYYY-MM-DD" value="<fmt:formatDate value="${policy.startdateTicket}" pattern="yyyy-MM-dd"/>" type="text" class="inputbox85" />
		-	
		<input id="enfdateTicket" name="enfdateTicket" check=2 tip="输入格式：YYYY-MM-DD" value="<fmt:formatDate value="${policy.enfdateTicket}" pattern="yyyy-MM-dd"/>" type="text" class="inputbox85" />
		<input type="checkbox" name="checkbox"  onclick="setTavelDate()" class="check" id="like"/> 
		同旅行期限相同
		</li>
	  <li class="listwhile"><span class="colorFF0000">&lowast;</span> 旅行期限
	    <input id="startDate" name="startDate" check=2 tip="输入格式：YYYY-MM-DD" value="<fmt:formatDate value="${policy.startDate}" pattern="yyyy-MM-dd"/>"  type="text" class="inputbox85" />
		-
		<input id="endDate" name="endDate" check=2 tip="输入格式：YYYY-MM-DD" value="<fmt:formatDate value="${policy.endDate}" pattern="yyyy-MM-dd"/>" type="text" class="inputbox85" />
		<font color="#999999"> 输入格式：YYYY-MM-DD，如：2010-01-02 </font>
	  </li>
	  <li class="listgrey"><span class="colorFF0000">&lowast;</span> 出票时限
	    <input id="beforeValidDay" name="beforeValidDay" value="${policy.beforeValidDay}"  type="text" class="inputbox60"  check=2 tip="只能输入正整数，且必须大于等于0" />
		&nbsp;&nbsp;<font color="#999999">含当天，只能输入正整数，且必须大于等于0。 例如：提前出票时限为2，旅行有效期开始日期为2010-07-07，则最晚出票时间为2010-07-05。 </font>
	  </li>
	  <li class="listwhile"><span class="colorFF0000">&lowast;</span> 起飞机场
	    <input id="dpt" name="dpt" value="${policy.dpt}" type="text" class="inputbox120"  maxlength="3" check=2 tip="只支持一个起飞机场，输入只支持机场三字码，如PEK"  />
		<font color="#999999"> 只支持一个起飞机场，输入只支持机场三字码，如PEK  </font>
	  </li>
	  <li class="listgrey"><span class="colorFF0000">&lowast;</span> 到达机场
	    <input id="arrCity" name="arr" value="${policy.arr}" type="text" class="inputbox120"  maxlength="3" check=2 tip="仅普通政策支持多个到达机场，多个机场用,分隔，最多支持25个机场。特价、特殊政策只支持一个到达机场。"  />
		 <font color="#999999">仅普通政策支持多个到达机场，多个机场用","分隔，最多支持25个机场。特价、特殊政策只支持一个到达机场。 </font>
	  </li>
	 <li class="listwhile_1"><span class="colorFF0000">&lowast;</span> 班期限制
			<c:forEach var="day" items="${dayArry}">
 			<c:set var="checked" value="false"></c:set>
 			<c:forEach var="selectDay" items="${selectDayArry}">
 				<c:if test="${day==selectDay}">
 				<c:set var="checked" value="true"></c:set>
 				</c:if>	
 			</c:forEach>
 			<c:if test="${empty policy.policyId}">
 				<c:set var="checked" value="true"></c:set>
 			</c:if>	
 			<input type="checkbox" name="daycondition" class="check" <c:if test="${checked==true}">checked="checked" </c:if> value="${day}">${day}&nbsp;&nbsp;
 		</c:forEach>
		<font color="#999999">周一至周日,周日用7表示 </font>
	  </li>
	  <li class="listgrey"><span class="colorFF0000">&lowast;</span> 航班号码
	    <input type="radio" name="flightNumLimit" onclick="disabledFlight(this)" value="1" class="check" <c:if test="${empty policy.flightNumLimit || policy.flightNumLimit==1 }"> checked="checked"</c:if>/> 该航段全部航班
		&nbsp;&nbsp; / <input type="radio" name="flightNumLimit" onclick="disabledFlight(this)" value="2" class="check" <c:if test="${policy.flightNumLimit==2}"> checked="checked"</c:if>/> 该航段除了
		<input name="withOut" id="withOut" type="text" class="inputbox60" disabled="disabled" <c:if test="${policy.flightNumLimit==2}"> value=${policy.flightCondition}</c:if> /> 之外的航班
		&nbsp;&nbsp;  / <input type="radio"  name="flightNumLimit" onclick="disabledFlight(this)" value="3" class="check" <c:if test="${policy.flightNumLimit==3}"> checked="checked"</c:if>/> 仅以下航班
		<input name="withIn" id="withIn" type="text" class="inputbox60" disabled="disabled"  <c:if test="${policy.flightNumLimit==3}"> value=${policy.flightCondition}</c:if> />
		<font color="#999999">可多个航班号，用","分隔，如：CA1145, CA6524 </font>
	  </li>
		<li class="listwhile_1" id="autoTicket" <c:if test="${param['type']!=3}">style="display: none;"</c:if>>&nbsp;&nbsp;自动出票
	    <input type="radio" name="autoTicket" value="" class="check" />是
		&nbsp;&nbsp;<input type="radio" name="autoTicket" value="" class="check" checked="checked"/>否
		</li>	
		<li class="listgrey">&nbsp;&nbsp; 返还点数
	    <input id="returnPoint" name="returnPoint" value="${policy.returnPoint}" type="text" class="inputbox85" check="2" tip="只支持数字输入，精确到两位小数" /> %
		<font color="#999999">只支持数字输入，精确到两位小数，如：15.25，代表返点15.25 </font>
	  </li>
	  <li class="listwhile_1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;留 钱
	   <input id="returnPrice" name="returnPrice" value="${policy.returnPrice}" type="text" class="inputbox85" check="2" tip="支持正负整数输入"/> 元
		<font color="#999999">支持正负整数输入 </font>
	  </li>
		<li class="listgrey" id="showPata" <c:if test="${param['type']!=3}">style="display: none;"</c:if>>&nbsp;&nbsp;&nbsp;是否进行PAT：A校验
		 <input type="radio" name="pata" value="1" class="check" checked="checked"/>是
		&nbsp;&nbsp;<input type="radio" name="pata" value="0" class="check" />否</li>
		
		 <li class="listwhile_1" name="auto" <c:if test="${param['type']!=3}">style="display: none;"</c:if> ><span class="colorFF0000">&lowast;</span> K位类型
				<select onchange="showLx(this)" class="inputbox120">
 					<option value="0">指定舱位K位</option>
 					<option value="1">见舱K位</option>
 				</select>
 				
			<font color="#999999">支持“指定舱位K位”、“见舱K位两种类型”  </font> / <span class="colorFF0000">&lowast;</span> K位方式
			<input type="radio" name="kType" value="0" onclick="showKtype(this)"/>手动&nbsp;&nbsp;
			<input type="radio" name="kType" value="1" checked="checked" onclick="showKtype(this)"/>自动
		</li>
		
		 <li class="listwhile_1" name="auto" id="lx" style="display: none;"><span class="colorFF0000">&lowast;</span> 向下浮动点数
		 	<input id="downDiscount" name="downDiscount" value="${policy.downDiscount}" class="inputbox85"/>
		</li>
		
		 <li id="disenbleKtype" name="auto" <c:if test="${param['type']!=3}">style="display: none;"</c:if> class="listgrey"><span class="colorFF0000">&lowast;</span> 巡查周期
		<input name="manualCheckOverTime"  type="text" class="inputbox85" id=manualCheckOverTime check=2 tip="巡查周期指多长时间内检查一次K位结果，只支持整数输入，范围3-9如输入3，表示每3分钟检查一次K位结果"/>（分钟）
		<font color="#999999">巡查周期指多长时间内检查一次K位结果，只支持整数输入，范围3-9如输入3，表示每3分钟检查一次K位结果。 </font>
		</li>
			
		 <li class="listwhile_1"name="auto" <c:if test="${param['type']!=3}">style="display: none;"</c:if> >巡查总时间
		 <input name="autoCheckOverTime" id="autoCheckOverTime" type="text" class="inputbox85" />（分钟）
		<font color="#999999">巡查总时间指多长时间内无k位结果，不改变订单状态终止轮询，只支持整数输入，最大值不能超过30  </font>
		 
		 </li>
		<li class="listgrey" id="showPay" <c:if test="${param['type']!=4}">style="display: none;"</c:if> >
			<fmt:message key="policy.canPay"/>
			<input name="canPay" type="radio" value="1" checked="checked"/>是
			<input name="canPay" type="radio" value="0"/>否
		</li>
		
		<li class="listwhile_1" name="showCabin" <c:if test="${param['type']!=4}">style="display: none;"</c:if>><span class="colorFF0000">&lowast;</span> 适用舱位
	    <input name="cabin" value="${policy.cabin}" type="text" class="inputbox85" maxlength="1"  check=2 tip="仅支持大写,如F "/>
		<font color="#999999">仅普通政策允许多个舱位，多个舱位不需要分隔符，如：FCX  </font>
	  </li>
	  
	  
	  <li class="listgrey" name="showCabin" <c:if test="${param['type']!=4}">style="display: none;"</c:if>><span class="colorFF0000">&lowast;</span> 可售舱位
	    <input name="allCabin" value="${policy.allCabin}" type="text" class="inputbox85" maxlength="3"  check=2 tip="只支持数字输入"/>
		<font color="#999999">只支持数字输入，保存后，只能查询，不能修改  </font>
	  </li>
	  
	   <li class="listwhile_1" name="showCabin" <c:if test="${param['type']!=4}">style="display: none;"</c:if>><span class="colorFF0000">&lowast;</span> 剩余舱位
	    <input  name="restCabin" value="${policy.restCabin}" type="text" class="inputbox85" readonly="readonly"/>
		<font color="#999999">系统自动读取，不能填写更改   </font>
	  </li>
	  
	  
	  	<li class="listgrey" id="showPnr" <c:if test="${param['type']!=5}">style="display: none;"</c:if>>
 				<fmt:message key="policy.needPnr"/>
				<input name="needPnr" type="radio" value="1" checked="checked"/>是
				<input name="needPnr" type="radio" value="0"/>否
 				<fmt:message key="policy.shared"/>
				<input name="shared" type="radio" value="1" checked="checked"/>是
				<input name="shared" type="radio" value="0"/>否
 				<label><fmt:message key="policy.pata"/></label>
				<input name="pata" type="radio" value="1" checked="checked"/>是
				<input name="pata" type="radio" value="0"/>否
			</li>
	  
	  <li class="listwhile" id="showDiscountType" <%-- <c:if test="${param['type']!=5}">style="display: none;"</c:if> --%>><span class="colorFF0000">&lowast;</span> 票面价类型
	  <select name="discountType" class="inputbox85" onchange="showValue(this);">
						 <option value="3">Y舱折扣</option>
 						<option value="4">指定票面价</option>
						</select>
	  </li>
	  <li class="listgrey" id="yCharge"><span class="colorFF0000">&lowast;</span> Y舱折扣
	   <input id="yValue" name="yDiscount" value="${policy.yDiscount }" type="text" class="inputbox85" id=floatNumer check=2 tip="必须为大于等于0并且小于等于1的数字" /> 
		<font color="#999999">必须为大于等于0并且小于等于1的数字  </font>
	  </li>
	    <li class="listgrey" style="display: none;" id="zd"><span class="colorFF0000">&lowast;</span> 指定票面价
	   <input id="zdValue" name="discountValue" value="${policy.discountValue}" type="text" class="inputbox85" id=floatNumer check=2 tip="必须为10的整数倍 " /> 
		<font color="#999999">必须为10的整数倍  </font>
	  </li>
	  
	  <li class="listwhile_1">成本价类型&nbsp;&nbsp;
	  <input type="radio" name="costType" <c:if test="${empty policy.costType || policy.costType==1}">checked="checked"</c:if> onclick="showDiscountType(1)" value="1"/>指定成本价
	&nbsp;&nbsp;<input type="radio" name="costType" <c:if test="${policy.costType==0}">checked="checked"</c:if> onclick="showDiscountType(2)" value="0"/>指定代理费率 
	  </li>
	  <li class="listgrey" id="showDiscount" <c:if test="${policy.costType==0}">style="display: none;"</c:if>><span class="colorFF0000">&lowast;</span>&nbsp;成本价格
	    <input id="discountValue" name="costPrice" value="${policy.costPrice}" type="text" class="inputbox85" />
	  </li>
	  <li class="listgrey" id="showZpoint" <c:if test="${empty policy.costType || policy.costType==1}">style="display: none;"</c:if>><span class="colorFF0000">&lowast;</span>&nbsp;&nbsp;&nbsp;
  	基础代理费率/z值 <input id="proxyPrice" name="proxyPrice" value="${policy.proxyPrice}" type="text" class="inputbox85" />
         后返 <input id="backPrice" name="backPrice" value="${policy.backPrice}" type="text" class="inputbox85" />
	  </li>
	 <li class="listwhile_1"><span class="colorFF0000">&lowast;</span>&nbsp;&nbsp;&nbsp;退改签
	    <textarea id="backNote" name="backNote"  class="inputboxminilarge" id=text1 check=2 tip="不能为空">${policy.backNote}</textarea>
	  </li>
	 <li class="listwhile_1"><span class="colorFF0000">&lowast;</span> 舱位说明
	      <textarea id="cabinNote" name="cabinNote"  class="inputboxminilarge" id=text2 check=2 tip="不能为空 ">${policy.cabinNote}</textarea>
	  </li> 
	   <li class="listwhile">政策状态：<fmt:message key="policy.status${policy.status}"></fmt:message>
	   <input type="hidden" value="1" name="status">
	  </li>
	  <li class="listwhile">
	    <input name="Submit2" type="submit" class="inputsubmit" value="返回" />
		<input name="Submit2" type="submit" class="inputsubmit" value="添加" />
	  </li>
	</ul>
			</form:form>
  </body>
</html>